﻿app.service('dicSet', function ($http) {
    var apiURL = serverURL + '/tddimension';
    //var paramCallback = QueryUriParamBuilder.queryParam('callback', 'JSON_CALLBACK').build();

    this.GetAll = function () {
        //return $http.jsonp(apiURL + paramCallback);
        return $http.get(apiURL);
    }

    this.Add = function (data) {
        return $http.post(apiURL, data);
    }

    this.Edit = function (data) {
        return $http.put(apiURL, data);
    }

    this.Delete = function (id) {
        var params = QueryUriParamBuilder.queryParam("tid", "del").queryParam("id", id).build();
        //return $http.delete(apiURL + params);
        return $http.get(apiURL + params);
    }
});